<!-- studyCourseRichtextNew.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>富文本章节页</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
		<link rel="stylesheet" href="../../css/base.css">
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
		<style type="text/css">
			:focus {
				outline: 0;
			}
			.title_bulk {
				min-width: 60px;
				height: 44px;
			}
			.back_btn {
				color: white;
				font-size: 16px;
			}
			#nav_title {
				font-size: 16px;
				text-overflow: ellipsis;
				overflow: hidden;
				white-space: nowrap;
				word-break: keep-all;
			}
			p {
				color: #222222;
				font-size: 14px;
			}
		</style>
	</head>
	<body>
		<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
		<div id="header" class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="onBackClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="nav_title"></span>
			<a class="base_right_item base_hide_item"   id="bewrite" ></a>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/databaseOperation.js"></script>
	<script type="text/javascript">
		var dataFunType = '0';
		var pageParam = '';
		var userType;
		DBReady = function() {
			//     alert('富文本页');
			
			pageParam = api.pageParam;
			
			userType = pageParam.userType;
			var is_dis_bewrite = pageParam.is_dis_bewrite;
			if (is_dis_bewrite != "" && is_dis_bewrite != null && is_dis_bewrite != undefined) {
				if (is_dis_bewrite == "1") {
					$('#bewrite').removeClass('base_hide_item');
					$('#bewrite').addClass('base_visible_item');
				}
			}
			$('#nav_title').text(htmlspecialchars_decode(api.pageParam.cdetailtitle));
			// var y = document.getElementById('header').offsetHeight;
			var y = $('#BarAppearance').height() + $('.base_navigation_bar').height();
			var h = api.winHeight - y;
			if (pageParam.richtextType == 1) {
				sendBuriedNotifi('0', '自由课程富文本', '149');
				api.openFrame({
					name : 'Study_FreeCourseRichtextNew',
					url : 'Study_FreeCourseRichtextNew.html',
					bounces : false,
					rect : {
						x : 0,
						y : y,
						w : 'auto',
						h : h
					},
					pageParam : pageParam
				});
			} else {
				sendBuriedNotifi('0', 'mooc图文', '011');
				api.openFrame({
					name : 'studyCourseRichtextFrame',
					url : 'studyCourseRichtextFrame.html',
					bounces : false,
					rect : {
						x : 0,
						y : y,
						w : 'auto',
						h : h
					},
					pageParam : pageParam
				});
			}
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				onBackClick();
			})
		}
		//		sendBuriedNotifi('0', '学生端课程考核页', '074');
		function onBackClick() {
			//退出时发送结束学习通知
			api.sendEvent({
			    name: 'freeCourseRecordNotifi',
			    extra: {
			        uid : $api.getStorage('cfnetppuid'),
					jid : $api.getStorage('cfnetppjxid'),
					cid : api.pageParam.cid,
					vid : api.pageParam.vid,
					pid : api.pageParam.pid
			    }
			});
			if (pageParam.richtextType == 1) {//自由课程
				sendBuriedNotifi('1', '自由课程富文本', '149');
				api.closeWin({
					name : 'Student_Free_bewrite'
				});
				api.closeWin();
			} else {//mooc
				sendBuriedNotifi('1', 'mooc图文', '011');
				api.closeWin();
			}
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				vid : api.pageParam.vid
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
	</script>
</html>
